package com.un.ebs.purchase.mapper;

import com.un.ebs.purchase.domain.PurchaseOrder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author liubo
 * @since 2020-05-30
 */
@Component
public interface PurchaseOrderMapper extends BaseMapper<PurchaseOrder> {

    @Select("SELECT ISNULL(MAX(RIGHT(code,4)),0) FROM dbo.tb_purchase_order WHERE CONVERT(VARCHAR(4),create_time,112)= CONVERT(VARCHAR(4),GETDATE(),112)")
    int maxCode();
}
